PCISoundInputDriver.c is intended to help those developers who wish to make a PCI sound input driver for their hardware or are looking to see how a classic sound input driver interacts with the Sound Input Manager.
The Sound Input Manager is defined to work with classic 68K drivers, and this shapes how it expects sound input drivers to behave. For instance, it expects drivers to be able to put up a dialog and respond to user events. This is clearly something that was not intended to happen in the PCI driver model.
Luckily the Mac can be a pretty forgiving place and PCI drivers can actually call ModalDialog without crashing, at least for now.
In the future, if the rules are tightened to the point where the gross violations of the PCI driver spec that I show here are no longer tolerated then the only option for PCI sound hardware vendors will be to create a 68K sound input driver which interacts with their PCI hardware driver (or go with some completely new driver model that hasn't been invented yet). This, while seemingly simple, is not because of the fact that the 68K driver can only ever issue asynchronous calls to the PCI driver. This greatly complicates the logic required to perform some of the simpler actions the driver must do, but no one ever said progress was painless.
Because I took the simple route with this driver, I don't have Finalize, Supersede, or Replace functions that do anything. Those are left for the reader to fill out as desired, but the Sound Input Manager doesn't know about them and therefore doesn't expect them to be impletented.
Also, because the Sound Input Manager was designed for 68K drivers and there is no PCI family expert for sound input drivers, I am forced to call NewHandle, etc., instead of being able to use PoolAllocate.
The bottom line is that this sample works and it shows how to register a driver with the Sound Input Manager and respond to the Sound Input Manager. It may not continue to work if the PCI driver model is moved to other platforms or imposes significant restrictions, but in the mean time it does its job.
Because I don't have any hardware to cause the Mac OS to load this ndrv, this sample includes the Load PCI Driver(PPC) application which can be used to load the driver "PCISoundInputDriver" so that you can play with it in the Sound control panel. Load PCI Driver(PPC) even supports drag&drop!
As a side note, the MakeSquareWave code was copied from another sample I did, which is why it isn't really tailored for this sample, but hey, it works.
If you have any questions, comments or bug reports, please send them to devsupport@apple.com.